package com.my.study.designPatterns.decoratePattern;

/**
 * 具体装饰者类Soy
 */
public class Soy extends CondimentDecorator {

    //被装饰的类
    private Beverage beverage;

    public Soy(Beverage beverage) {
        this.beverage = beverage;

    }

    @Override
    public double cost() {
        return beverage.cost() + 0.21;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Soy";
    }
}
